Home > complex-toolbox > Complex DVV > dvv.m

dvv

PURPOSE ^

Delay Vector Variance method for real and complex signals

SYNOPSIS ^

function data = dvv (X, m, Nsub, nd, Ntv)

DESCRIPTION ^

 Delay Vector Variance method for real and complex signals


 USAGE: C = dvv (X, m, Nsub, nd, Ntv)

 Input:
    X       original real-valued or complex time series
    m       delay embedding dimension
    Ntv     number of points on horizontal axes
    Nsub    number of reference DVs to consider
    nd      Span over which to perform DVV
 ...........................................

 Complex Valued Nonlinear Adaptive Filtering toolbox for MATLAB
 Supplementary to the book:
 
 "Complex Valued Nonlinear Adaptive Filters: Noncircularity, Widely Linear and Neural Models"
 by Danilo P. Mandic and Vanessa Su Lee Goh
 
 (c) Copyright Danilo P. Mandic 2009
 http://www.commsp.ee.ic.ac.uk/~mandic
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
 
    You can obtain a copy of the GNU General Public License from
    http://www.gnu.org/copyleft/gpl.html or by writing to
    Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA.
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 ...........................................

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % Delay Vector Variance method for real and complex signals
0002 %
0003 %
0004 % USAGE: C = dvv (X, m, Nsub, nd, Ntv)
0005 %
0006 % Input:
0007 %    X       original real-valued or complex time series
0008 %    m       delay embedding dimension
0009 %    Ntv     number of points on horizontal axes
0010 %    Nsub    number of reference DVs to consider
0011 %    nd      Span over which to perform DVV
0012 % ...........................................
0013 %
0014 % Complex Valued Nonlinear Adaptive Filtering toolbox for MATLAB
0015 % Supplementary to the book:
0016 %
0017 % "Complex Valued Nonlinear Adaptive Filters: Noncircularity, Widely Linear and Neural Models"
0018 % by Danilo P. Mandic and Vanessa Su Lee Goh
0019 %
0020 % (c) Copyright Danilo P. Mandic 2009
0021 % http://www.commsp.ee.ic.ac.uk/~mandic
0022 %
0023 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0024 %    This program is free software; you can redistribute it and/or modify
0025 %    it under the terms of the GNU General Public License as published by
0026 %    the Free Software Foundation; either version 2 of the License, or
0027 %    (at your option) any later version.
0028 %
0029 %    This program is distributed in the hope that it will be useful,
0030 %    but WITHOUT ANY WARRANTY; without even the implied warranty of
0031 %    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0032 %    GNU General Public License for more details.
0033 %
0034 %    You can obtain a copy of the GNU General Public License from
0035 %    http://www.gnu.org/copyleft/gpl.html or by writing to
0036 %    Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA.
0037 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0038 % ...........................................
0039 function data = dvv (X, m, Nsub, nd, Ntv)
0040 
0041 % Default parameters
0042 if (nargin<1)
0043     error('Not enough Input arguments');
0044 end
0045 if (nargin<2)
0046     m = 4;
0047 end
0048 if (nargin<3)
0049     Nsub = 200;
0050 end
0051 if (nargin<4)
0052     nd = 2.0;
0053 end
0054 if (nargin<5)
0055     Ntv = 25*nd;
0056 end
0057 
0058 % Initial Conditions
0059 N = length(X);              % Length of input vector
0060 tau = 1;                    % Time delay parameter
0061 d = zeros(N-m*tau, Nsub);
0062 y = zeros(Ntv,1);
0063 count = 0;
0064 acc = 0;
0065 
0066 
0067 % Makes input vector X a column vector
0068 if (size(X,2)>size(X,1))
0069     X = X';
0070 end
0071 
0072 % Generate Nsub subset from existing DV's, randomly
0073 temp = randperm (N - m*tau);
0074 ref = temp(1:Nsub) + m*tau;
0075 
0076 % Computes the pair wise distances b/w reference DV's and all DV's
0077 for i = 1:Nsub
0078     for j = m*tau+1:N
0079         d(j-m*tau,i) = norm (X(ref(i)-m*tau:tau:ref(i)-tau) - X(j-m*tau:tau:j-tau));
0080         if (ref(i) ~= j)
0081             acc = acc + d(j-m*tau,i);
0082             count = count + 1;
0083         end
0084     end
0085 end
0086 
0087 % Mean and std variation calculation of input data
0088 avg = acc/count;
0089 count = 0;
0090 acc = 0;
0091 for i = 1:Nsub
0092     for j = m*tau + 1:N
0093         if (ref(i) ~= j)
0094             acc = acc + (d(j-m*tau,i)-avg).^2;
0095         end
0096     end
0097 end
0098 variance = sqrt(acc/(count-1));
0099 
0100 % Calculates the range vector consisting of Ntv equally spaced regions
0101 n = (1:Ntv)-1;
0102 rd = avg-nd*variance + (2*nd*variance*n)/(Ntv-1);
0103 
0104 % Creates sets of DV's, for each ref element of subset and value rd, which have norms closer than distance rd to ref
0105 for n = 1:length(rd)
0106     
0107     if (rd(n)>0)
0108         
0109         tot = 0;
0110         count = 0;
0111         
0112         for k=1:Nsub
0113             
0114             IND = find(d(:,k) <= rd(n)) + m*tau;
0115             IND = IND(IND~=k);
0116             
0117             
0118             % Only those variance values are considered for which the corresponding
0119             % sets have atleast 30 DVs
0120             if (length(IND) >= 30)
0121                 tot = tot + var(X(IND));
0122                 count = count+1;
0123             end
0124         end
0125         if (~count)
0126             y(n) = NaN;
0127         else
0128             y(n) = tot/(count*var(X));
0129         end
0130         
0131     else
0132         y(n) = NaN;
0133     end
0134     
0135 end
0136 
0137 % Horizontal axis
0138 T = (rd'-avg)/variance;
0139 
0140 % DVV Output
0141 data = [T y];

Generated on Tue 21-Apr-2009 19:50:21 by m2html © 2003